package com.cbt.cbtBlog.util;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.Tokenizer;
import org.apache.lucene.analysis.Analyzer.TokenStreamComponents;

public final class MyIKAnalyzer extends Analyzer {
   private boolean useSmart;

   public boolean useSmart() {
      return this.useSmart;
   }

   public void setUseSmart(boolean useSmart) {
      this.useSmart = useSmart;
   }

   public MyIKAnalyzer() {
      this(false);
   }

   protected TokenStreamComponents createComponents(String s) {
      Tokenizer _MyIKTokenizer = new MyIKTokenizer(this.useSmart());
      return new TokenStreamComponents(_MyIKTokenizer);
   }

   public MyIKAnalyzer(boolean useSmart) {
      this.useSmart = useSmart;
   }
}
